package org.vison.wonfu.framework.soa.governance;

import lombok.Data;

import static org.vison.wonfu.framework.soa.SoaConstants.DEFAULT_CIRCLE_BREAKER_MANUAL_BREAKER;
import static org.vison.wonfu.framework.soa.SoaConstants.DEFAULT_CIRCLE_BREAKER_ENABLE;
import static org.vison.wonfu.framework.soa.SoaConstants.DEFAULT_CIRCLE_BREAKER_ERROR_RATE_THRESHOLD;
import static org.vison.wonfu.framework.soa.SoaConstants.DEFAULT_CIRCLE_BREAKER_REQUEST_THRESHOLD;
import static org.vison.wonfu.framework.soa.SoaConstants.DEFAULT_CIRCLE_BREAKER_SLIDING_WINDOW_SIZE;
import static org.vison.wonfu.framework.soa.SoaConstants.DEFAULT_CIRCLE_BREAKER_SUCCESS_THRESHOLD;

@Data
public class GovernanceConfig {
    private boolean circuitBreakerManualBreaker;
    private boolean circuitBreakerEnable;
    private int circuitBreakerSlidingWindowSize;
    private int circuitBreakerSuccessThreshold;
    private int circuitBreakerRequestThreshold;
    private double circuitBreakerErrorRateThreshold;

    public GovernanceConfig() {
        this.circuitBreakerManualBreaker = DEFAULT_CIRCLE_BREAKER_MANUAL_BREAKER;
        this.circuitBreakerEnable = DEFAULT_CIRCLE_BREAKER_ENABLE;
        this.circuitBreakerSlidingWindowSize = DEFAULT_CIRCLE_BREAKER_SLIDING_WINDOW_SIZE;
        this.circuitBreakerSuccessThreshold = DEFAULT_CIRCLE_BREAKER_SUCCESS_THRESHOLD;
        this.circuitBreakerRequestThreshold = DEFAULT_CIRCLE_BREAKER_REQUEST_THRESHOLD;
        this.circuitBreakerErrorRateThreshold = DEFAULT_CIRCLE_BREAKER_ERROR_RATE_THRESHOLD;
    }
}
